
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:xiongan_app_yy/net/internet_api.dart';
import 'package:xiongan_app_yy/utils/device_utils.dart';
import 'package:xiongan_app_yy/utils/sp_utils.dart';
import 'package:xiongan_app_yy/utils/version_utils.dart';

class Global {
  // 是否为release版
  static bool get isRelease => bool.fromEnvironment("dart.vm.product");

  //初始化全局信息，会在APP启动时执行
  static Future init() async {
    //初始化sp
    await SpUtil.getInstance();
    //初始化获取本地版本
    await VersionUtils.getNativeVersion();
    //初始化网络请求相关配置
    InternetAPI.getInstance();
    //初始化文件下载
    await FlutterDownloader.initialize();

    await DeviceUtils.getDeviceInfo();
  }
}
